package com.tl.juc.c4;

import java.util.LinkedList;

public class C4_SleepAndWait {
    public static final Object monitor = new Object();

    public static void main(String[] args) throws InterruptedException {
        Thread mainThread = Thread.currentThread();
        Thread thread = new Thread(() ->{
            System.out.println(mainThread.getState());
        });

        thread.start();
        synchronized (monitor) {
            monitor.wait(2000);
        }
        LinkedList<Integer> list = new LinkedList<>();
        for (int i=0;i<100;i++){
            list.add(i);
        }
        list.get(0);

    }
}
